<?php
/**
 * Created by PhpStorm.
 * User: 钊鑫
 * Date: 2019/1/23
 * Time: 10:19
 */
namespace app\api\model;

use think\Model;

class Base extends Model
{
    protected function baseSetImgUrl ($value,$data){
        $finalUrl = $value;
        if($data['from'] == 1){
            $api_url = SysConfig::where('key','api_url')->value('value');
            $value=str_replace("\\","/",$value);
            $finalUrl = $api_url.$value;
        }
        return $finalUrl;
    }

    public function getCreateTimeAttr($v)
    {
        return date("Y-m-d",$v);
    }
}